home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gdb.idb / usr / freeware / info / gdbint.info-2.z / gdbint.info-2
Encoding:
GNU Info File  |  1998-10-28  |  46.2 KB  |  1,321 lines

  1. This is Info file gdbint.info, produced by Makeinfo version 1.68 from
  2. the input file ../../../devo/gdb/doc/gdbint.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Gdb-Internals: (gdbint).    The GNU debugger's internals.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents the internals of the GNU debugger GDB.
  9.  
  10.    Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software
  11. Foundation, Inc.  Contributed by Cygnus Support.  Written by John
  12. Gilmore.
  13.  
  14.    Permission is granted to make and distribute verbatim copies of this
  15. manual provided the copyright notice and this permission notice are
  16. preserved on all copies.
  17.  
  18.    Permission is granted to copy or distribute modified versions of this
  19. manual under the terms of the GPL (for which purpose this text may be
  20. regarded as a program in the language TeX).
  21.  
  22. 
  23. File: gdbint.info,  Node: Remote Stubs,  Next: Longjmp Support,  Prev: Frames,  Up: Top
  24.  
  25. Remote Stubs
  26. ************
  27.  
  28.    GDB's file `remote.c' talks a serial protocol to code that runs in
  29. the target system.  GDB provides several sample "stubs" that can be
  30. integrated into target programs or operating systems for this purpose;
  31. they are named `*-stub.c'.
  32.  
  33.    The GDB user's manual describes how to put such a stub into your
  34. target code.  What follows is a discussion of integrating the SPARC stub
  35. into a complicated operating system (rather than a simple program), by
  36. Stu Grossman, the author of this stub.
  37.  
  38.    The trap handling code in the stub assumes the following upon entry
  39. to trap_low:
  40.  
  41.   1. %l1 and %l2 contain pc and npc respectively at the time of the trap
  42.  
  43.   2. traps are disabled
  44.  
  45.   3. you are in the correct trap window
  46.  
  47.    As long as your trap handler can guarantee those conditions, then
  48. there is no reason why you shouldn't be able to `share' traps with the
  49. stub.  The stub has no requirement that it be jumped to directly from
  50. the hardware trap vector.  That is why it calls `exceptionHandler()',
  51. which is provided by the external environment.  For instance, this
  52. could setup the hardware traps to actually execute code which calls the
  53. stub first, and then transfers to its own trap handler.
  54.  
  55.    For the most point, there probably won't be much of an issue with
  56. `sharing' traps, as the traps we use are usually not used by the
  57. kernel, and often indicate unrecoverable error conditions.  Anyway,
  58. this is all controlled by a table, and is trivial to modify.  The most
  59. important trap for us is for `ta 1'.  Without that, we can't single
  60. step or do breakpoints.  Everything else is unnecessary for the proper
  61. operation of the debugger/stub.
  62.  
  63.    From reading the stub, it's probably not obvious how breakpoints
  64. work.  They are simply done by deposit/examine operations from GDB.
  65.  
  66. 
  67. File: gdbint.info,  Node: Longjmp Support,  Next: Coding Style,  Prev: Remote Stubs,  Up: Top
  68.  
  69. Longjmp Support
  70. ***************
  71.  
  72.    GDB has support for figuring out that the target is doing a
  73. `longjmp' and for stopping at the target of the jump, if we are
  74. stepping.  This is done with a few specialized internal breakpoints,
  75. which are visible in the `maint info breakpoint' command.
  76.  
  77.    To make this work, you need to define a macro called
  78. `GET_LONGJMP_TARGET', which will examine the `jmp_buf' structure and
  79. extract the longjmp target address.  Since `jmp_buf' is target
  80. specific, you will need to define it in the appropriate `tm-xxx.h'
  81. file.  Look in `tm-sun4os4.h' and `sparc-tdep.c' for examples of how to
  82. do this.
  83.  
  84. 
  85. File: gdbint.info,  Node: Coding Style,  Next: Clean Design,  Prev: Longjmp Support,  Up: Top
  86.  
  87. Coding Style
  88. ************
  89.  
  90.    GDB is generally written using the GNU coding standards, as
  91. described in `standards.texi', which is available for anonymous FTP
  92. from GNU archive sites.  There are some additional considerations for
  93. GDB maintainers that reflect the unique environment and style of GDB
  94. maintenance.  If you follow these guidelines, GDB will be more
  95. consistent and easier to maintain.
  96.  
  97.    GDB's policy on the use of prototypes is that prototypes are used to
  98. *declare* functions but never to *define* them.  Simple macros are used
  99. in the declarations, so that a non-ANSI compiler can compile GDB
  100. without trouble.  The simple macro calls are used like this:
  101.  
  102.      extern int
  103.      memory_remove_breakpoint PARAMS ((CORE_ADDR, char *));
  104.  
  105.    Note the double parentheses around the parameter types.  This allows
  106. an arbitrary number of parameters to be described, without freaking out
  107. the C preprocessor.  When the function has no parameters, it should be
  108. described like:
  109.  
  110.      void
  111.      noprocess PARAMS ((void));
  112.  
  113.    The `PARAMS' macro expands to its argument in ANSI C, or to a simple
  114. `()' in traditional C.
  115.  
  116.    All external functions should have a `PARAMS' declaration in a
  117. header file that callers include.  All static functions should have such
  118. a declaration near the top of their source file.
  119.  
  120.    We don't have a gcc option that will properly check that these rules
  121. have been followed, but it's GDB policy, and we periodically check it
  122. using the tools available (plus manual labor), and clean up any
  123. remnants.
  124.  
  125. 
  126. File: gdbint.info,  Node: Clean Design,  Next: Submitting Patches,  Prev: Coding Style,  Up: Top
  127.  
  128. Clean Design
  129. ************
  130.  
  131.    In addition to getting the syntax right, there's the little question
  132. of semantics.  Some things are done in certain ways in GDB because long
  133. experience has shown that the more obvious ways caused various kinds of
  134. trouble.  In particular:
  135.  
  136. *
  137.      You can't assume the byte order of anything that comes from a
  138.      target (including VALUEs, object files, and instructions).  Such
  139.      things must be byte-swapped using `SWAP_TARGET_AND_HOST' in GDB,
  140.      or one of the swap routines defined in `bfd.h', such as
  141.      `bfd_get_32'.
  142.  
  143. *
  144.      You can't assume that you know what interface is being used to
  145.      talk to the target system.  All references to the target must go
  146.      through the current `target_ops' vector.
  147.  
  148. *
  149.      You can't assume that the host and target machines are the same
  150.      machine (except in the "native" support modules).  In particular,
  151.      you can't assume that the target machine's header files will be
  152.      available on the host machine.  Target code must bring along its
  153.      own header files - written from scratch or explicitly donated by
  154.      their owner, to avoid copyright problems.
  155.  
  156. *
  157.      Insertion of new `#ifdef''s will be frowned upon.  It's much better
  158.      to write the code portably than to conditionalize it for various
  159.      systems.
  160.  
  161. *
  162.      New `#ifdef''s which test for specific compilers or manufacturers
  163.      or operating systems are unacceptable.  All `#ifdef''s should test
  164.      for features.  The information about which configurations contain
  165.      which features should be segregated into the configuration files.
  166.      Experience has proven far too often that a feature unique to one
  167.      particular system often creeps into other systems; and that a
  168.      conditional based on some predefined macro for your current system
  169.      will become worthless over time, as new versions of your system
  170.      come out that behave differently with regard to this feature.
  171.  
  172. *
  173.      Adding code that handles specific architectures, operating
  174.      systems, target interfaces, or hosts, is not acceptable in generic
  175.      code.  If a hook is needed at that point, invent a generic hook
  176.      and define it for your configuration, with something like:
  177.  
  178.           #ifdef    WRANGLE_SIGNALS
  179.              WRANGLE_SIGNALS (signo);
  180.           #endif
  181.  
  182.      In your host, target, or native configuration file, as appropriate,
  183.      define `WRANGLE_SIGNALS' to do the machine-dependent thing.  Take
  184.      a bit of care in defining the hook, so that it can be used by other
  185.      ports in the future, if they need a hook in the same place.
  186.  
  187.      If the hook is not defined, the code should do whatever "most"
  188.      machines want.  Using `#ifdef', as above, is the preferred way to
  189.      do this, but sometimes that gets convoluted, in which case use
  190.  
  191.           #ifndef SPECIAL_FOO_HANDLING
  192.           #define SPECIAL_FOO_HANDLING(pc, sp) (0)
  193.           #endif
  194.  
  195.      where the macro is used or in an appropriate header file.
  196.  
  197.      Whether to include a "small" hook, a hook around the exact pieces
  198.      of code which are system-dependent, or whether to replace a whole
  199.      function with a hook depends on the case.  A good example of this
  200.      dilemma can be found in `get_saved_register'.  All machines that
  201.      GDB 2.8 ran on just needed the `FRAME_FIND_SAVED_REGS' hook to
  202.      find the saved registers.  Then the SPARC and Pyramid came along,
  203.      and `HAVE_REGISTER_WINDOWS' and `REGISTER_IN_WINDOW_P' were
  204.      introduced.  Then the 29k and 88k required the `GET_SAVED_REGISTER'
  205.      hook.  The first three are examples of small hooks; the latter
  206.      replaces a whole function.  In this specific case, it is useful to
  207.      have both kinds; it would be a bad idea to replace all the uses of
  208.      the small hooks with `GET_SAVED_REGISTER', since that would result
  209.      in much duplicated code.  Other times, duplicating a few lines of
  210.      code here or there is much cleaner than introducing a large number
  211.      of small hooks.
  212.  
  213.      Another way to generalize GDB along a particular interface is with
  214.      an attribute struct.  For example, GDB has been generalized to
  215.      handle multiple kinds of remote interfaces - not by #ifdef's
  216.      everywhere, but by defining the "target_ops" structure and having
  217.      a current target (as well as a stack of targets below it, for
  218.      memory references).  Whenever something needs to be done that
  219.      depends on which remote interface we are using, a flag in the
  220.      current target_ops structure is tested (e.g.  `target_has_stack'),
  221.      or a function is called through a pointer in the current
  222.      target_ops structure.  In this way, when a new remote interface is
  223.      added, only one module needs to be touched - the one that actually
  224.      implements the new remote interface.  Other examples of
  225.      attribute-structs are BFD access to multiple kinds of object file
  226.      formats, or GDB's access to multiple source languages.
  227.  
  228.      Please avoid duplicating code.  For example, in GDB 3.x all the
  229.      code interfacing between `ptrace' and the rest of GDB was
  230.      duplicated in `*-dep.c', and so changing something was very
  231.      painful.  In GDB 4.x, these have all been consolidated into
  232.      `infptrace.c'.  `infptrace.c' can deal with variations between
  233.      systems the same way any system-independent file would (hooks, #if
  234.      defined, etc.), and machines which are radically different don't
  235.      need to use infptrace.c at all.
  236.  
  237. *
  238.      *Do* write code that doesn't depend on the sizes of C data types,
  239.      the format of the host's floating point numbers, the alignment of
  240.      anything, or the order of evaluation of expressions.  In short,
  241.      follow good programming practices for writing portable C code.
  242.  
  243. 
  244. File: gdbint.info,  Node: Submitting Patches,  Next: Host Conditionals,  Prev: Clean Design,  Up: Top
  245.  
  246. Submitting Patches
  247. ******************
  248.  
  249.    Thanks for thinking of offering your changes back to the community of
  250. GDB users.  In general we like to get well designed enhancements.
  251. Thanks also for checking in advance about the best way to transfer the
  252. changes.
  253.  
  254.    The two main problems with getting your patches in are,
  255.  
  256. *
  257.      The GDB maintainers will only install "cleanly designed" patches.
  258.      You may not always agree on what is clean design.  *note Coding
  259.      Style::., *note Clean Design::..
  260.  
  261. *
  262.      If the maintainers don't have time to put the patch in when it
  263.      arrives, or if there is any question about a patch, it goes into a
  264.      large queue with everyone else's patches and bug reports.
  265.  
  266.    I don't know how to get past these problems except by continuing to
  267. try.
  268.  
  269.    There are two issues here - technical and legal.
  270.  
  271.    The legal issue is that to incorporate substantial changes requires a
  272. copyright assignment from you and/or your employer, granting ownership
  273. of the changes to the Free Software Foundation.  You can get the
  274. standard document for doing this by sending mail to
  275. `gnu@prep.ai.mit.edu' and asking for it.  I recommend that people write
  276. in "All programs owned by the Free Software Foundation" as "NAME OF
  277. PROGRAM", so that changes in many programs (not just GDB, but GAS,
  278. Emacs, GCC, etc) can be contributed with only one piece of legalese
  279. pushed through the bureacracy and filed with the FSF.  I can't start
  280. merging changes until this paperwork is received by the FSF (their
  281. rules, which I follow since I maintain it for them).
  282.  
  283.    Technically, the easiest way to receive changes is to receive each
  284. feature as a small context diff or unidiff, suitable for "patch".  Each
  285. message sent to me should include the changes to C code and header
  286. files for a single feature, plus ChangeLog entries for each directory
  287. where files were modified, and diffs for any changes needed to the
  288. manuals (gdb/doc/gdb.texi or gdb/doc/gdbint.texi).  If there are a lot
  289. of changes for a single feature, they can be split down into multiple
  290. messages.
  291.  
  292.    In this way, if I read and like the feature, I can add it to the
  293. sources with a single patch command, do some testing, and check it in.
  294. If you leave out the ChangeLog, I have to write one.  If you leave out
  295. the doc, I have to puzzle out what needs documenting.  Etc.
  296.  
  297.    The reason to send each change in a separate message is that I will
  298. not install some of the changes.  They'll be returned to you with
  299. questions or comments.  If I'm doing my job, my message back to you
  300. will say what you have to fix in order to make the change acceptable.
  301. The reason to have separate messages for separate features is so that
  302. other changes (which I *am* willing to accept) can be installed while
  303. one or more changes are being reworked.  If multiple features are sent
  304. in a single message, I tend to not put in the effort to sort out the
  305. acceptable changes from the unacceptable, so none of the features get
  306. installed until all are acceptable.
  307.  
  308.    If this sounds painful or authoritarian, well, it is.  But I get a
  309. lot of bug reports and a lot of patches, and most of them don't get
  310. installed because I don't have the time to finish the job that the bug
  311. reporter or the contributor could have done.  Patches that arrive
  312. complete, working, and well designed, tend to get installed on the day
  313. they arrive.  The others go into a queue and get installed if and when
  314. I scan back over the queue - which can literally take months sometimes.
  315. It's in both our interests to make patch installation easy - you get
  316. your changes installed, and I make some forward progress on GDB in a
  317. normal 12-hour day (instead of them having to wait until I have a
  318. 14-hour or 16-hour day to spend cleaning up patches before I can
  319. install them).
  320.  
  321.    Please send patches to `bug-gdb@prep.ai.mit.edu', if they are less
  322. than about 25,000 characters.  If longer than that, either make them
  323. available somehow (e.g. anonymous FTP), and announce it on `bug-gdb',
  324. or send them directly to the GDB maintainers at
  325. `gdb-patches@cygnus.com'.
  326.  
  327. 
  328. File: gdbint.info,  Node: Host Conditionals,  Next: Target Conditionals,  Prev: Submitting Patches,  Up: Top
  329.  
  330. Host Conditionals
  331. *****************
  332.  
  333.    When GDB is configured and compiled, various macros are defined or
  334. left undefined, to control compilation based on the attributes of the
  335. host system.  These macros and their meanings (or if the meaning is not
  336. documented here, then one of the source files where they are used is
  337. indicated) are:
  338.  
  339. `GDBINIT_FILENAME'
  340.      The default name of GDB's initialization file (normally
  341.      `.gdbinit').
  342.  
  343. `MEM_FNS_DECLARED'
  344.      Your host config file defines this if it includes declarations of
  345.      `memcpy' and `memset'.  Define this to avoid conflicts between the
  346.      native include files and the declarations in `defs.h'.
  347.  
  348. `NO_SYS_FILE'
  349.      Define this if your system does not have a `<sys/file.h>'.
  350.  
  351. `SIGWINCH_HANDLER'
  352.      If your host defines `SIGWINCH', you can define this to be the
  353.      name of a function to be called if `SIGWINCH' is received.
  354.  
  355. `SIGWINCH_HANDLER_BODY'
  356.      Define this to expand into code that will define the function
  357.      named by the expansion of `SIGWINCH_HANDLER'.
  358.  
  359. `ALIGN_STACK_ON_STARTUP'
  360.      Define this if your system is of a sort that will crash in
  361.      `tgetent' if the stack happens not to be longword-aligned when
  362.      `main' is called.  This is a rare situation, but is known to occur
  363.      on several different types of systems.
  364.  
  365. `CRLF_SOURCE_FILES'
  366.      Define this if host files use `\r\n' rather than `\n' as a line
  367.      terminator.  This will cause source file listings to omit `\r'
  368.      characters when printing.  It must be possible to open files in
  369.      binary mode using `O_BINARY' or, for fopen, `"rb"'.
  370.  
  371. `DEFAULT_PROMPT'
  372.      The default value of the prompt string (normally `"(gdb) "').
  373.  
  374. `DEV_TTY'
  375.      The name of the generic TTY device, defaults to `"/dev/tty"'.
  376.  
  377. `FCLOSE_PROVIDED'
  378.      Define this if the system declares `fclose' in the headers
  379.      included in `defs.h'.  This isn't needed unless your compiler is
  380.      unusually anal.
  381.  
  382. `FOPEN_RB'
  383.      Define this if binary files are opened the same way as text files.
  384.  
  385. `GETENV_PROVIDED'
  386.      Define this if the system declares `getenv' in its headers
  387.      included in `defs.h'. This isn't needed unless your compiler is
  388.      unusually anal.
  389.  
  390. `HAVE_MMAP'
  391.      In some cases, use the system call `mmap' for reading symbol
  392.      tables.  For some machines this allows for sharing and quick
  393.      updates.
  394.  
  395. `HAVE_SIGSETMASK'
  396.      Define this if the host system has job control, but does not
  397.      define `sigsetmask()'.  Currently, this is only true of the
  398.      RS/6000.
  399.  
  400. `HAVE_TERMIO'
  401.      Define this if the host system has `termio.h'.
  402.  
  403. `HOST_BYTE_ORDER'
  404.      The ordering of bytes in the host.  This must be defined to be
  405.      either `BIG_ENDIAN' or `LITTLE_ENDIAN'.
  406.  
  407. `INT_MAX'
  408.  
  409. `INT_MIN'
  410.  
  411. `LONG_MAX'
  412.  
  413. `UINT_MAX'
  414.  
  415. `ULONG_MAX'
  416.      Values for host-side constants.
  417.  
  418. `ISATTY'
  419.      Substitute for isatty, if not available.
  420.  
  421. `KERNEL_U_ADDR'
  422.      Define this to the address of the `u' structure (the "user struct",
  423.      also known as the "u-page") in kernel virtual memory.  GDB needs
  424.      to know this so that it can subtract this address from absolute
  425.      addresses in the upage, that are obtained via ptrace or from core
  426.      files.  On systems that don't need this value, set it to zero.
  427.  
  428. `KERNEL_U_ADDR_BSD'
  429.      Define this to cause GDB to determine the address of `u' at
  430.      runtime, by using Berkeley-style `nlist' on the kernel's image in
  431.      the root directory.
  432.  
  433. `KERNEL_U_ADDR_HPUX'
  434.      Define this to cause GDB to determine the address of `u' at
  435.      runtime, by using HP-style `nlist' on the kernel's image in the
  436.      root directory.
  437.  
  438. `LONGEST'
  439.      This is the longest integer type available on the host.  If not
  440.      defined, it will default to `long long' or `long', depending on
  441.      `CC_HAS_LONG_LONG'.
  442.  
  443. `CC_HAS_LONG_LONG'
  444.      Define this if the host C compiler supports "long long".  This is
  445.      set by the configure script.
  446.  
  447. `PRINTF_HAS_LONG_LONG'
  448.      Define this if the host can handle printing of long long integers
  449.      via the printf format directive "ll". This is set by the configure
  450.      script.
  451.  
  452. `HAVE_LONG_DOUBLE'
  453.      Define this if the host C compiler supports "long double".  This
  454.      is set by the configure script.
  455.  
  456. `PRINTF_HAS_LONG_DOUBLE'
  457.      Define this if the host can handle printing of long double
  458.      float-point numbers via the printf format directive "Lg". This is
  459.      set by the configure script.
  460.  
  461. `SCANF_HAS_LONG_DOUBLE'
  462.      Define this if the host can handle the parsing of long double
  463.      float-point numbers via the scanf format directive directive "Lg".
  464.      This is set by the configure script.
  465.  
  466. `LSEEK_NOT_LINEAR'
  467.      Define this if `lseek (n)' does not necessarily move to byte number
  468.      `n' in the file.  This is only used when reading source files.  It
  469.      is normally faster to define `CRLF_SOURCE_FILES' when possible.
  470.  
  471. `L_SET'
  472.      This macro is used as the argument to lseek (or, most commonly,
  473.      bfd_seek).  FIXME, should be replaced by SEEK_SET instead, which
  474.      is the POSIX equivalent.
  475.  
  476. `MAINTENANCE_CMDS'
  477.      If the value of this is 1, then a number of optional maintenance
  478.      commands are compiled in.
  479.  
  480. `MALLOC_INCOMPATIBLE'
  481.      Define this if the system's prototype for `malloc' differs from the
  482.      ANSI definition.
  483.  
  484. `MMAP_BASE_ADDRESS'
  485.      When using HAVE_MMAP, the first mapping should go at this address.
  486.  
  487. `MMAP_INCREMENT'
  488.      when using HAVE_MMAP, this is the increment between mappings.
  489.  
  490. `NEED_POSIX_SETPGID'
  491.      Define this to use the POSIX version of `setpgid' to determine
  492.      whether job control is available.
  493.  
  494. `NORETURN'
  495.      If defined, this should be one or more tokens, such as `volatile',
  496.      that can be used in both the declaration and definition of
  497.      functions to indicate that they never return.  The default is
  498.      already set correctly if compiling with GCC.  This will almost
  499.      never need to be defined.
  500.  
  501. `ATTR_NORETURN'
  502.      If defined, this should be one or more tokens, such as
  503.      `__attribute__ ((noreturn))', that can be used in the declarations
  504.      of functions to indicate that they never return.  The default is
  505.      already set correctly if compiling with GCC.  This will almost
  506.      never need to be defined.
  507.  
  508. `USE_MMALLOC'
  509.      GDB will use the `mmalloc' library for memory allocation for symbol
  510.      reading if this symbol is defined.  Be careful defining it since
  511.      there are systems on which `mmalloc' does not work for some
  512.      reason.  One example is the DECstation, where its RPC library
  513.      can't cope with our redefinition of `malloc' to call `mmalloc'.
  514.      When defining `USE_MMALLOC', you will also have to set `MMALLOC'
  515.      in the Makefile, to point to the mmalloc library.  This define is
  516.      set when you configure with -with-mmalloc.
  517.  
  518. `NO_MMCHECK'
  519.      Define this if you are using `mmalloc', but don't want the overhead
  520.      of checking the heap with `mmcheck'.  Note that on some systems,
  521.      the C runtime makes calls to malloc prior to calling `main', and if
  522.      `free' is ever called with these pointers after calling `mmcheck'
  523.      to enable checking, a memory corruption abort is certain to occur.
  524.      These systems can still use mmalloc, but must define NO_MMCHECK.
  525.  
  526. `MMCHECK_FORCE'
  527.      Define this to 1 if the C runtime allocates memory prior to
  528.      `mmcheck' being called, but that memory is never freed so we don't
  529.      have to worry about it triggering a memory corruption abort.  The
  530.      default is 0, which means that `mmcheck' will only install the
  531.      heap checking functions if there has not yet been any memory
  532.      allocation calls, and if it fails to install the functions, gdb
  533.      will issue a warning.  This is currently defined if you configure
  534.      using -with-mmalloc.
  535.  
  536. `NO_SIGINTERRUPT'
  537.      Define this to indicate that siginterrupt() is not available.
  538.  
  539. `R_OK'
  540.      Define if this is not in a system .h file.
  541.  
  542. `SEEK_CUR'
  543.  
  544. `SEEK_SET'
  545.      Define these to appropriate value for the system lseek(), if not
  546.      already defined.
  547.  
  548. `STOP_SIGNAL'
  549.      This is the signal for stopping GDB.  Defaults to SIGTSTP.  (Only
  550.      redefined for the Convex.)
  551.  
  552. `USE_O_NOCTTY'
  553.      ???
  554.  
  555. `USG'
  556.      Means that System V (prior to SVR4) include files are in use.
  557.      (FIXME:  This symbol is abused in `infrun.c', `regex.c',
  558.      `remote-nindy.c', and `utils.c' for other things, at the moment.)
  559.  
  560. `lint'
  561.      Define this to help lint in some stupid way.
  562.  
  563. `volatile'
  564.      Define this to override the defaults of `__volatile__' or `/**/'.
  565.  
  566.    Platform-specific host conditionals.
  567.  
  568. `ALTOS_AS'
  569.      xm-altos.h
  570.  
  571. `MOTOROLA'
  572.      xm-altos.h
  573.  
  574. `NBPG'
  575.      altos-xdep.c
  576.  
  577. `DELTA88'
  578.      m88k-xdep.c
  579.  
  580. `DGUX'
  581.      m88k-xdep.c
  582.  
  583. `F_OK'
  584.      xm-ultra3.h
  585.  
  586. `UPAGES'
  587.      altos-xdep.c
  588.  
  589.    Regex conditionals.
  590.  
  591. `C_ALLOCA'
  592.      regex.c
  593.  
  594. `NFAILURES'
  595.      regex.c
  596.  
  597. `RE_NREGS'
  598.      regex.h
  599.  
  600. `SIGN_EXTEND_CHAR'
  601.      regex.c
  602.  
  603. `SWITCH_ENUM_BUG'
  604.      regex.c
  605.  
  606. `SYNTAX_TABLE'
  607.      regex.c
  608.  
  609. `Sword'
  610.      regex.c
  611.  
  612. `sparc'
  613.      regex.c
  614.  
  615. 
  616. File: gdbint.info,  Node: Target Conditionals,  Next: Native Conditionals,  Prev: Host Conditionals,  Up: Top
  617.  
  618. Target Conditionals
  619. *******************
  620.  
  621.    When GDB is configured and compiled, various macros are defined or
  622. left undefined, to control compilation based on the attributes of the
  623. target system.  These macros and their meanings are:
  624.  
  625. `ADDITIONAL_OPTIONS'
  626.  
  627. `ADDITIONAL_OPTION_CASES'
  628.  
  629. `ADDITIONAL_OPTION_HANDLER'
  630.  
  631. `ADDITIONAL_OPTION_HELP'
  632.      These are a set of macros that allow the addition of additional
  633.      command line options to GDB.  They are currently used only for the
  634.      unsupported i960 Nindy target, and should not be used in any other
  635.      configuration.
  636.  
  637. `ADDR_BITS_REMOVE (addr)'
  638.      If a raw machine address includes any bits that are not really part
  639.      of the address, then define this macro to expand into an expression
  640.      that zeros those bits in ADDR.  For example, the two low-order
  641.      bits of a Motorola 88K address may be used by some kernels for
  642.      their own purposes, since addresses must always be 4-byte aligned,
  643.      and so are of no use for addressing.  Those bits should be
  644.      filtered out with an expression such as `((addr) & ~3)'.
  645.  
  646. `BEFORE_MAIN_LOOP_HOOK'
  647.      Define this to expand into any code that you want to execute before
  648.      the main loop starts.  Although this is not, strictly speaking, a
  649.      target conditional, that is how it is currently being used.  Note
  650.      that if a configuration were to define it one way for a host and a
  651.      different way for the target, GDB will probably not compile, let
  652.      alone run correctly.
  653.  
  654. `BELIEVE_PCC_PROMOTION'
  655.      coffread.c
  656.  
  657. `BELIEVE_PCC_PROMOTION_TYPE'
  658.      stabsread.c
  659.  
  660. `BITS_BIG_ENDIAN'
  661.      Define this if the numbering of bits in the targets does *not*
  662.      match the endianness of the target byte order.  A value of 1 means
  663.      that the bits are numbered in a big-endian order, 0 means
  664.      little-endian.
  665.  
  666. `BREAKPOINT'
  667.      This is the character array initializer for the bit pattern to put
  668.      into memory where a breakpoint is set.  Although it's common to
  669.      use a trap instruction for a breakpoint, it's not required; for
  670.      instance, the bit pattern could be an invalid instruction.  The
  671.      breakpoint must be no longer than the shortest instruction of the
  672.      architecture.
  673.  
  674. `BIG_BREAKPOINT'
  675.  
  676. `LITTLE_BREAKPOINT'
  677.      Similar to BREAKPOINT, but used for bi-endian targets.
  678.  
  679. `CALL_DUMMY'
  680.      valops.c
  681.  
  682. `CALL_DUMMY_LOCATION'
  683.      inferior.h
  684.  
  685. `CALL_DUMMY_STACK_ADJUST'
  686.      valops.c
  687.  
  688. `CANNOT_FETCH_REGISTER (regno)'
  689.      A C expression that should be nonzero if REGNO cannot be fetched
  690.      from an inferior process.  This is only relevant if
  691.      `FETCH_INFERIOR_REGISTERS' is not defined.
  692.  
  693. `CANNOT_STORE_REGISTER (regno)'
  694.      A C expression that should be nonzero if REGNO should not be
  695.      written to the target.  This is often the case for program
  696.      counters, status words, and other special registers.  If this is
  697.      not defined, GDB will assume that all registers may be written.
  698.  
  699. `CHILL_PRODUCER'
  700.  
  701. `GCC_PRODUCER'
  702.  
  703. `GPLUS_PRODUCER'
  704.  
  705. `LCC_PRODUCER'
  706.      If defined, these are the producer strings in a DWARF 1 file.  All
  707.      of these have reasonable defaults already.
  708.  
  709. `DO_DEFERRED_STORES'
  710.  
  711. `CLEAR_DEFERRED_STORES'
  712.      Define this to execute any deferred stores of registers into the
  713.      inferior, and to cancel any deferred stores.
  714.  
  715.      Currently only implemented correctly for native Sparc
  716.      configurations?
  717.  
  718. `CPLUS_MARKER'
  719.      Define this to expand into the character that G++ uses to
  720.      distinguish compiler-generated identifiers from
  721.      programmer-specified identifiers.  By default, this expands into
  722.      `'$''.  Most System V targets should define this to `'.''.
  723.  
  724. `DBX_PARM_SYMBOL_CLASS'
  725.      Hook for the `SYMBOL_CLASS' of a parameter when decoding DBX symbol
  726.      information.  In the i960, parameters can be stored as locals or as
  727.      args, depending on the type of the debug record.
  728.  
  729. `DECR_PC_AFTER_BREAK'
  730.      Define this to be the amount by which to decrement the PC after
  731.      the program encounters a breakpoint.  This is often the number of
  732.      bytes in BREAKPOINT, though not always.  For most targets this
  733.      value will be 0.
  734.  
  735. `DECR_PC_AFTER_HW_BREAK'
  736.      Similarly, for hardware breakpoints.
  737.  
  738. `DISABLE_UNSETTABLE_BREAK addr'
  739.      If defined, this should evaluate to 1 if ADDR is in a shared
  740.      library in which breakpoints cannot be set and so should be
  741.      disabled.
  742.  
  743. `DO_REGISTERS_INFO'
  744.      If defined, use this to print the value of a register or all
  745.      registers.
  746.  
  747. `END_OF_TEXT_DEFAULT'
  748.      This is an expression that should designate the end of the text
  749.      section (? FIXME ?)
  750.  
  751. `EXTRACT_RETURN_VALUE'
  752.      tm-m68k.h
  753.  
  754. `EXTRACT_STRUCT_VALUE_ADDRESS'
  755.      values.c
  756.  
  757. `EXTRA_FRAME_INFO'
  758.      If defined, this must be a list of slots that may be inserted into
  759.      the `frame_info' structure defined in `frame.h'.
  760.  
  761. `EXTRA_SYMTAB_INFO'
  762.      If defined, this must be a list of slots that may be inserted into
  763.      the `symtab' structure defined in `symtab.h'.
  764.  
  765. `FLOAT_INFO'
  766.      If defined, then the `info float' command will print information
  767.      about the processor's floating point unit.
  768.  
  769. `FP_REGNUM'
  770.      The number of the frame pointer register.
  771.  
  772. `FRAMELESS_FUNCTION_INVOCATION'
  773.      blockframe.c
  774.  
  775. `FRAME_ARGS_ADDRESS_CORRECT'
  776.      stack.c
  777.  
  778. `FRAME_CHAIN'
  779.      Given FRAME, return a pointer to the calling frame.
  780.  
  781. `FRAME_CHAIN_COMBINE'
  782.      blockframe.c
  783.  
  784. `FRAME_CHAIN_VALID'
  785.      frame.h
  786.  
  787. `FRAME_CHAIN_VALID_ALTERNATE'
  788.      frame.h
  789.  
  790. `FRAME_FIND_SAVED_REGS'
  791.      stack.c
  792.  
  793. `FRAME_NUM_ARGS (val, fi)'
  794.      For the frame described by fi, set val to the number of arguments
  795.      that are being passed.
  796.  
  797. `FRAME_SPECIFICATION_DYADIC'
  798.      stack.c
  799.  
  800. `FRAME_SAVED_PC'
  801.      Given FRAME, return the pc saved there.  That is, the return
  802.      address.
  803.  
  804. `FUNCTION_EPILOGUE_SIZE'
  805.      For some COFF targets, the `x_sym.x_misc.x_fsize' field of the
  806.      function end symbol is 0.  For such targets, you must define
  807.      `FUNCTION_EPILOGUE_SIZE' to expand into the standard size of a
  808.      function's epilogue.
  809.  
  810. `GCC_COMPILED_FLAG_SYMBOL'
  811.  
  812. `GCC2_COMPILED_FLAG_SYMBOL'
  813.      If defined, these are the names of the symbols that GDB will look
  814.      for to detect that GCC compiled the file.  The default symbols are
  815.      `gcc_compiled.' and `gcc2_compiled.', respectively. (Currently
  816.      only defined for the Delta 68.)
  817.  
  818. `GDB_TARGET_IS_HPPA'
  819.      This determines whether horrible kludge code in dbxread.c and
  820.      partial-stab.h is used to mangle multiple-symbol-table files from
  821.      HPPA's.  This should all be ripped out, and a scheme like
  822.      elfread.c used.
  823.  
  824. `GDB_TARGET_IS_MACH386'
  825.      mach386-xdep.c
  826.  
  827. `GDB_TARGET_IS_SUN3'
  828.      a68v-xdep.c
  829.  
  830. `GDB_TARGET_IS_SUN386'
  831.      sun386-xdep.c
  832.  
  833. `GET_LONGJMP_TARGET'
  834.      For most machines, this is a target-dependent parameter.  On the
  835.      DECstation and the Iris, this is a native-dependent parameter,
  836.      since <setjmp.h> is needed to define it.
  837.  
  838.      This macro determines the target PC address that longjmp() will
  839.      jump to, assuming that we have just stopped at a longjmp
  840.      breakpoint.  It takes a CORE_ADDR * as argument, and stores the
  841.      target PC value through this pointer.  It examines the current
  842.      state of the machine as needed.
  843.  
  844. `GET_SAVED_REGISTER'
  845.      Define this if you need to supply your own definition for the
  846.      function `get_saved_register'.  Currently this is only done for
  847.      the a29k.
  848.  
  849. `GR64_REGNUM'
  850.      Very a29k-specific.
  851.  
  852. `HAVE_REGISTER_WINDOWS'
  853.      Define this if the target has register windows.
  854.  
  855. `REGISTER_IN_WINDOW_P regnum'
  856.      Define this to be an expression that is 1 is the given register is
  857.      in the window.
  858.  
  859. `IBM6000_TARGET'
  860.      Shows that we are configured for an IBM RS/6000 target.  This
  861.      conditional should be eliminated (FIXME) and replaced by
  862.      feature-specific macros.  It was introduced in haste and we are
  863.      repenting at leisure.
  864.  
  865. `IEEE_FLOAT'
  866.      Define this if the target system uses IEEE-format floating point
  867.      numbers.
  868.  
  869. `IGNORE_SYMBOL type'
  870.      This seems to be no longer used.
  871.  
  872. `INIT_EXTRA_FRAME_INFO (fromleaf, fci)'
  873.      If defined, this should be a C expression or statement that fills
  874.      in the `EXTRA_FRAME_INFO' slots of the given frame FCI.
  875.  
  876. `INIT_EXTRA_SYMTAB_INFO'
  877.      symfile.c
  878.  
  879. `INIT_FRAME_PC (fromleaf, prev)'
  880.      This is a C statement that sets the pc of the frame pointed to by
  881.      PREV.  [By default...]
  882.  
  883. `INNER_THAN'
  884.      Define this to be either `<' if the target's stack grows downward
  885.      in memory, or `>' is the stack grows upwards.
  886.  
  887. `IN_SIGTRAMP (pc name)'
  888.      Define this to return true if the given pc and/or name indicates
  889.      that the current function is a sigtramp.
  890.  
  891. `SIGTRAMP_START (pc)'
  892.  
  893. `SIGTRAMP_END (pc)'
  894.      Define these to be the start and end address of the sigtramp for
  895.      the given pc.  On machines where the address is just a compile
  896.      time constant, the macro expansion will typically just ignore the
  897.      supplied pc.
  898.  
  899. `IN_SOLIB_TRAMPOLINE pc name'
  900.      Define this to evaluate to nonzero if the program is stopped in
  901.      the trampoline that connects to a shared library.
  902.  
  903. `IS_TRAPPED_INTERNALVAR name'
  904.      This is an ugly hook to allow the specification of special actions
  905.      that should occur as a side-effect of setting the value of a
  906.      variable internal to GDB.  Currently only used by the h8500.  Note
  907.      that this could be either a host or target conditional.
  908.  
  909. `KERNEL_DEBUGGING'
  910.      tm-ultra3.h
  911.  
  912. `MIPSEL'
  913.      mips-tdep.c
  914.  
  915. `NEED_TEXT_START_END'
  916.      Define this if GDB should determine the start and end addresses of
  917.      the text section.  (Seems dubious.)
  918.  
  919. `KERNEL_DEBUGGING'
  920.  
  921. `NO_HIF_SUPPORT'
  922.      (Specific to the a29k.)
  923.  
  924. `NO_SINGLE_STEP'
  925.      Define this if the target does not support single-stepping.  If
  926.      this is defined, you must supply, in `*-tdep.c', the function
  927.      `single_step', which takes a target_signal as argument and returns
  928.      nothing.  It must insert breakpoints at each possible destinations
  929.      of the next instruction.  See `sparc-tdep.c' and `rs6000-tdep.c'
  930.      for examples.
  931.  
  932. `PCC_SOL_BROKEN'
  933.      (Used only in the Convex target.)
  934.  
  935. `PC_IN_CALL_DUMMY'
  936.      inferior.h
  937.  
  938. `PC_LOAD_SEGMENT'
  939.      If defined, print information about the load segment for the
  940.      program counter.  (Defined only for the RS/6000.)
  941.  
  942. `PC_REGNUM'
  943.      If the program counter is kept in a register, then define this
  944.      macro to be the number of that register.  This need be defined
  945.      only if `TARGET_WRITE_PC' is not defined.
  946.  
  947. `NPC_REGNUM'
  948.      The number of the "next program counter" register, if defined.
  949.  
  950. `NNPC_REGNUM'
  951.      The number of the "next next program counter" register, if defined.
  952.      Currently, this is only defined for the Motorola 88K.
  953.  
  954. `PRINT_REGISTER_HOOK (regno)'
  955.      If defined, this must be a function that prints the contents of the
  956.      given register to standard output.
  957.  
  958. `PRINT_TYPELESS_INTEGER'
  959.      This is an obscure substitute for `print_longest' that seems to
  960.      have been defined for the Convex target.
  961.  
  962. `PROCESS_LINENUMBER_HOOK'
  963.      A hook defined for XCOFF reading.
  964.  
  965. `PROLOGUE_FIRSTLINE_OVERLAP'
  966.      (Only used in unsupported Convex configuration.)
  967.  
  968. `PS_REGNUM'
  969.      If defined, this is the number of the processor status register.
  970.      (This definition is only used in generic code when parsing "$ps".)
  971.  
  972. `POP_FRAME'
  973.      Used in `call_function_by_hand' to remove an artificial stack
  974.      frame.
  975.  
  976. `PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)'
  977.      Define this to push arguments onto the stack for inferior function
  978.      call.
  979.  
  980. `PUSH_DUMMY_FRAME'
  981.      Used in `call_function_by_hand' to create an artificial stack
  982.      frame.
  983.  
  984. `REGISTER_BYTES'
  985.      The total amount of space needed to store GDB's copy of the
  986.      machine's register state.
  987.  
  988. `REGISTER_NAMES'
  989.      Define this to expand into an initializer of an array of strings.
  990.      Each string is the name of a register.  [more detail]
  991.  
  992. `REG_STRUCT_HAS_ADDR (gcc_p, type)'
  993.      Define this to return 1 if the given type will be passed by pointer
  994.      rather than directly.
  995.  
  996. `SDB_REG_TO_REGNUM'
  997.      Define this to convert sdb register numbers into GDB regnums.  If
  998.      not defined, no conversion will be done.
  999.  
  1000. `SHIFT_INST_REGS'
  1001.      (Only used for m88k targets.)
  1002.  
  1003. `SKIP_PROLOGUE'
  1004.      A C statement that advances the PC across any function entry
  1005.      prologue instructions so as to reach "real" code.
  1006.  
  1007. `SKIP_PROLOGUE_FRAMELESS_P'
  1008.      A C statement that should behave similarly, but that can stop as
  1009.      soon as the function is known to have a frame.  If not defined,
  1010.      `SKIP_PROLOGUE' will be used instead.
  1011.  
  1012. `SKIP_TRAMPOLINE_CODE (pc)'
  1013.      If the target machine has trampoline code that sits between callers
  1014.      and the functions being called, then define this macro to return a
  1015.      new PC that is at the start of the real function.
  1016.  
  1017. `SP_REGNUM'
  1018.      Define this to be the number of the register that serves as the
  1019.      stack pointer.
  1020.  
  1021. `STAB_REG_TO_REGNUM'
  1022.      Define this to convert stab register numbers (as gotten from `r'
  1023.      declarations) into GDB regnums.  If not defined, no conversion
  1024.      will be done.
  1025.  
  1026. `STACK_ALIGN (addr)'
  1027.      Define this to adjust the address to the alignment required for the
  1028.      processor's stack.
  1029.  
  1030. `STEP_SKIPS_DELAY (addr)'
  1031.      Define this to return true if the address is of an instruction
  1032.      with a delay slot.  If a breakpoint has been placed in the
  1033.      instruction's delay slot, GDB will single-step over that
  1034.      instruction before resuming normally.  Currently only defined for
  1035.      the Mips.
  1036.  
  1037. `STORE_RETURN_VALUE (type, valbuf)'
  1038.      A C expression that stores a function return value of type TYPE,
  1039.      where VALBUF is the address of the value to be stored.
  1040.  
  1041. `SUN_FIXED_LBRAC_BUG'
  1042.      (Used only for Sun-3 and Sun-4 targets.)
  1043.  
  1044. `SYMBOL_RELOADING_DEFAULT'
  1045.      The default value of the `symbol-reloading' variable.  (Never
  1046.      defined in current sources.)
  1047.  
  1048. `TARGET_BYTE_ORDER'
  1049.      The ordering of bytes in the target.  This must be defined to be
  1050.      either `BIG_ENDIAN' or `LITTLE_ENDIAN'.
  1051.  
  1052. `TARGET_CHAR_BIT'
  1053.      Number of bits in a char; defaults to 8.
  1054.  
  1055. `TARGET_COMPLEX_BIT'
  1056.      Number of bits in a complex number; defaults to `2 *
  1057.      TARGET_FLOAT_BIT'.
  1058.  
  1059. `TARGET_DOUBLE_BIT'
  1060.      Number of bits in a double float; defaults to `8 *
  1061.      TARGET_CHAR_BIT'.
  1062.  
  1063. `TARGET_DOUBLE_COMPLEX_BIT'
  1064.      Number of bits in a double complex; defaults to `2 *
  1065.      TARGET_DOUBLE_BIT'.
  1066.  
  1067. `TARGET_FLOAT_BIT'
  1068.      Number of bits in a float; defaults to `4 * TARGET_CHAR_BIT'.
  1069.  
  1070. `TARGET_INT_BIT'
  1071.      Number of bits in an integer; defaults to `4 * TARGET_CHAR_BIT'.
  1072.  
  1073. `TARGET_LONG_BIT'
  1074.      Number of bits in a long integer; defaults to `4 *
  1075.      TARGET_CHAR_BIT'.
  1076.  
  1077. `TARGET_LONG_DOUBLE_BIT'
  1078.      Number of bits in a long double float; defaults to `2 *
  1079.      TARGET_DOUBLE_BIT'.
  1080.  
  1081. `TARGET_LONG_LONG_BIT'
  1082.      Number of bits in a long long integer; defaults to `2 *
  1083.      TARGET_LONG_BIT'.
  1084.  
  1085. `TARGET_PTR_BIT'
  1086.      Number of bits in a pointer; defaults to `TARGET_INT_BIT'.
  1087.  
  1088. `TARGET_SHORT_BIT'
  1089.      Number of bits in a short integer; defaults to `2 *
  1090.      TARGET_CHAR_BIT'.
  1091.  
  1092. `TARGET_READ_PC'
  1093.  
  1094. `TARGET_WRITE_PC (val, pid)'
  1095.  
  1096. `TARGET_READ_SP'
  1097.  
  1098. `TARGET_WRITE_SP'
  1099.  
  1100. `TARGET_READ_FP'
  1101.  
  1102. `TARGET_WRITE_FP'
  1103.      These change the behavior of `read_pc', `write_pc', `read_sp',
  1104.      `write_sp', `read_fp' and `write_fp'.  For most targets, these may
  1105.      be left undefined.  GDB will call the read and write register
  1106.      functions with the relevant `_REGNUM' argument.
  1107.  
  1108.      These macros are useful when a target keeps one of these registers
  1109.      in a hard to get at place;  for example, part in a segment
  1110.      register and part in an ordinary register.
  1111.  
  1112. `USE_STRUCT_CONVENTION (gcc_p, type)'
  1113.      If defined, this must be an expression that is nonzero if a value
  1114.      of the given TYPE being returned from a function must have space
  1115.      allocated for it on the stack.  GCC_P is true if the function
  1116.      being considered is known to have been compiled by GCC; this is
  1117.      helpful for systems where GCC is known to use different calling
  1118.      convention than other compilers.
  1119.  
  1120. `VARIABLES_INSIDE_BLOCK (desc, gcc_p)'
  1121.      For dbx-style debugging information, if the compiler puts variable
  1122.      declarations inside LBRAC/RBRAC blocks, this should be defined to
  1123.      be nonzero.  DESC is the value of `n_desc' from the `N_RBRAC'
  1124.      symbol, and GCC_P is true if GDB has noticed the presence of
  1125.      either the `GCC_COMPILED_SYMBOL' or the `GCC2_COMPILED_SYMBOL'.
  1126.      By default, this is 0.
  1127.  
  1128. `OS9K_VARIABLES_INSIDE_BLOCK (desc, gcc_p)'
  1129.      Similarly, for OS/9000.  Defaults to 1.
  1130.  
  1131. `WRS_ORIG'
  1132.      remote-vx.c
  1133.  
  1134. `test'
  1135.      (Define this to enable testing code in regex.c.)
  1136.  
  1137.    Motorola M68K target conditionals.
  1138.  
  1139. `BPT_VECTOR'
  1140.      Define this to be the 4-bit location of the breakpoint trap vector.
  1141.      If not defined, it will default to `0xf'.
  1142.  
  1143. `REMOTE_BPT_VECTOR'
  1144.      Defaults to `1'.
  1145.  
  1146. 
  1147. File: gdbint.info,  Node: Native Conditionals,  Next: Obsolete Conditionals,  Prev: Target Conditionals,  Up: Top
  1148.  
  1149. Native Conditionals
  1150. *******************
  1151.  
  1152.    When GDB is configured and compiled, various macros are defined or
  1153. left undefined, to control compilation when the host and target systems
  1154. are the same.  These macros should be defined (or left undefined) in
  1155. `nm-SYSTEM.h'.
  1156.  
  1157. `ATTACH_DETACH'
  1158.      If defined, then GDB will include support for the `attach' and
  1159.      `detach' commands.
  1160.  
  1161. `CHILD_PREPARE_TO_STORE'
  1162.      If the machine stores all registers at once in the child process,
  1163.      then define this to ensure that all values are correct.  This
  1164.      usually entails a read from the child.
  1165.  
  1166.      [Note that this is incorrectly defined in `xm-SYSTEM.h' files
  1167.      currently.]
  1168.  
  1169. `FETCH_INFERIOR_REGISTERS'
  1170.      Define this if the native-dependent code will provide its own
  1171.      routines `fetch_inferior_registers' and `store_inferior_registers'
  1172.      in `HOST-nat.c'.  If this symbol is *not* defined, and
  1173.      `infptrace.c' is included in this configuration, the default
  1174.      routines in `infptrace.c' are used for these functions.
  1175.  
  1176. `FILES_INFO_HOOK'
  1177.      (Only defined for Convex.)
  1178.  
  1179. `FP0_REGNUM'
  1180.      This macro is normally defined to be the number of the first
  1181.      floating point register, if the machine has such registers.  As
  1182.      such, it would appear only in target-specific code.  However,
  1183.      /proc support uses this to decide whether floats are in use on
  1184.      this target.
  1185.  
  1186. `GET_LONGJMP_TARGET'
  1187.      For most machines, this is a target-dependent parameter.  On the
  1188.      DECstation and the Iris, this is a native-dependent parameter,
  1189.      since <setjmp.h> is needed to define it.
  1190.  
  1191.      This macro determines the target PC address that longjmp() will
  1192.      jump to, assuming that we have just stopped at a longjmp
  1193.      breakpoint.  It takes a CORE_ADDR * as argument, and stores the
  1194.      target PC value through this pointer.  It examines the current
  1195.      state of the machine as needed.
  1196.  
  1197. `ONE_PROCESS_WRITETEXT'
  1198.      Define this to be able to, when a breakpoint insertion fails, warn
  1199.      the user that another process may be running with the same
  1200.      executable.
  1201.  
  1202. `PROC_NAME_FMT'
  1203.      Defines the format for the name of a `/proc' device.  Should be
  1204.      defined in `nm.h' *only* in order to override the default
  1205.      definition in `procfs.c'.
  1206.  
  1207. `PTRACE_FP_BUG'
  1208.      mach386-xdep.c
  1209.  
  1210. `PTRACE_ARG3_TYPE'
  1211.      The type of the third argument to the `ptrace' system call, if it
  1212.      exists and is different from `int'.
  1213.  
  1214. `REGISTER_U_ADDR'
  1215.      Defines the offset of the registers in the "u area"; *note Host::..
  1216.  
  1217. `SHELL_COMMAND_CONCAT'
  1218.      If defined, is a string to prefix on the shell command used to
  1219.      start the inferior.
  1220.  
  1221. `SHELL_FILE'
  1222.      If defined, this is the name of the shell to use to run the
  1223.      inferior.  Defaults to `"/bin/sh"'.
  1224.  
  1225. `SOLIB_ADD (filename, from_tty, targ)'
  1226.      Define this to expand into an expression that will cause the
  1227.      symbols in FILENAME to be added to GDB's symbol table.
  1228.  
  1229. `SOLIB_CREATE_INFERIOR_HOOK'
  1230.      Define this to expand into any shared-library-relocation code that
  1231.      you want to be run just after the child process has been forked.
  1232.  
  1233. `START_INFERIOR_TRAPS_EXPECTED'
  1234.      When starting an inferior, GDB normally expects to trap twice;
  1235.      once when the shell execs, and once when the program itself execs.
  1236.      If the actual number of traps is something other than 2, then
  1237.      define this macro to expand into the number expected.
  1238.  
  1239. `SVR4_SHARED_LIBS'
  1240.      Define this to indicate that SVR4-style shared libraries are in
  1241.      use.
  1242.  
  1243. `USE_PROC_FS'
  1244.      This determines whether small routines in `*-tdep.c', which
  1245.      translate register values between GDB's internal representation
  1246.      and the /proc representation, are compiled.
  1247.  
  1248. `U_REGS_OFFSET'
  1249.      This is the offset of the registers in the upage.  It need only be
  1250.      defined if the generic ptrace register access routines in
  1251.      `infptrace.c' are being used (that is, `infptrace.c' is configured
  1252.      in, and `FETCH_INFERIOR_REGISTERS' is not defined).  If the
  1253.      default value from `infptrace.c' is good enough, leave it
  1254.      undefined.
  1255.  
  1256.      The default value means that u.u_ar0 *points to* the location of
  1257.      the registers.  I'm guessing that `#define U_REGS_OFFSET 0' means
  1258.      that u.u_ar0 *is* the location of the registers.
  1259.  
  1260. `CLEAR_SOLIB'
  1261.      objfiles.c
  1262.  
  1263. `DEBUG_PTRACE'
  1264.      Define this to debug ptrace calls.
  1265.  
  1266. 
  1267. File: gdbint.info,  Node: Obsolete Conditionals,  Next: XCOFF,  Prev: Native Conditionals,  Up: Top
  1268.  
  1269. Obsolete Conditionals
  1270. *********************
  1271.  
  1272.    Fragments of old code in GDB sometimes reference or set the following
  1273. configuration macros.  They should not be used by new code, and old
  1274. uses should be removed as those parts of the debugger are otherwise
  1275. touched.
  1276.  
  1277. `STACK_END_ADDR'
  1278.      This macro used to define where the end of the stack appeared, for
  1279.      use in interpreting core file formats that don't record this
  1280.      address in the core file itself.  This information is now
  1281.      configured in BFD, and GDB gets the info portably from there.  The
  1282.      values in GDB's configuration files should be moved into BFD
  1283.      configuration files (if needed there), and deleted from all of
  1284.      GDB's config files.
  1285.  
  1286.      Any `FOO-xdep.c' file that references STACK_END_ADDR is so old
  1287.      that it has never been converted to use BFD.  Now that's old!
  1288.  
  1289. `PYRAMID_CONTROL_FRAME_DEBUGGING'
  1290.      pyr-xdep.c
  1291.  
  1292. `PYRAMID_CORE'
  1293.      pyr-xdep.c
  1294.  
  1295. `PYRAMID_PTRACE'
  1296.      pyr-xdep.c
  1297.  
  1298. `REG_STACK_SEGMENT'
  1299.      exec.c
  1300.  
  1301. 
  1302. File: gdbint.info,  Node: XCOFF,  Prev: Obsolete Conditionals,  Up: Top
  1303.  
  1304. The XCOFF Object File Format
  1305. ****************************
  1306.  
  1307.    The IBM RS/6000 running AIX uses an object file format called xcoff.
  1308. The COFF sections, symbols, and line numbers are used, but debugging
  1309. symbols are dbx-style stabs whose strings are located in the `.debug'
  1310. section (rather than the string table).  For more information, *Note
  1311. Top: (stabs)Top, and search for XCOFF.
  1312.  
  1313.    The shared library scheme has a nice clean interface for figuring out
  1314. what shared libraries are in use, but the catch is that everything which
  1315. refers to addresses (symbol tables and breakpoints at least) needs to be
  1316. relocated for both shared libraries and the main executable.  At least
  1317. using the standard mechanism this can only be done once the program has
  1318. been run (or the core file has been read).
  1319.  
  1320.  
  1321.